<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>文字强制不换行</title>
</head>
<body>
    <style>
        div {
            width: 50px;
            padding: 10px;
            background-color: blue;
            white-space: nowrap;
            color: #Fff;
        }

        span{
            display: inline-block;
            background-color: red;
        }
    </style>
    <div>
        <span>父元素样式文字不换行，子元素超过会直接溢出父元素</span>
    </div>
</body>
</html>